﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using RPGProject.Data_Structures;
namespace Lexer.SyntaxTree
{
    /// <summary>
    /// A node detailing an event.
    /// </summary>
    class EventSyntaxNode : SyntaxNode
    {
        private String name;
        private Vector<BinaryOperationSyntaxNode> args;

        public EventSyntaxNode()
        {
            this.args = new Vector<BinaryOperationSyntaxNode>();
        }

        public String Name
        {
            get { return this.name; }
            set { this.name = value; }
        }

        public void AddArgument(BinaryOperationSyntaxNode bin)
        {
            this.args.Add(bin);
        }
        public BinaryOperationSyntaxNode this[int i]
        {
            get {
                if (i > this.args.Count)
                    return null;
                else
                    return this.args[i];
            }
        }
        public int Count
        {
            get { return this.args.Count; }
        }
        public override string ToString()
        {
            String ret = "Event: " + this.name + " (";
            for (int i = 0; i < this.args.Count; i++)
            {
                ret += this.args[i];
            }
            ret += ")";
            return ret;
        }
    }
}
